﻿<div class="loginbox">
    <div ng-if="isAuthenticating">
        <div class="modal-body">
            正在验证，请等待 ...
        </div>
    </div>
    <div ng-if="!isAuthenticating">
        <div style="position:absolute;top:5px;right:10px;">
            <button type="button" class="close" ng-click="cancel()">&times;</button>
        </div>
        <div class="modal-header">
            <h2>登陆你的Paracraft账号</h2>
        </div>
        <div class="modal-body">
            <div class="box">
                <h4>第三方账号登陆</h4>
                <div class="form-group">
                    <a class="btn btn-default btn-block" role="button" ng-click="authenticate('github')">
                       <span style="position:relative;display:block;float:left;"><svg aria-hidden="true" height="20" width="20" version="1.1" viewBox="0 0 16 16"><path d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59 0.4 0.07 0.55-0.17 0.55-0.38 0-0.19-0.01-0.82-0.01-1.49-2.01 0.37-2.53-0.49-2.69-0.94-0.09-0.23-0.48-0.94-0.82-1.13-0.28-0.15-0.68-0.52-0.01-0.53 0.63-0.01 1.08 0.58 1.23 0.82 0.72 1.21 1.87 0.87 2.33 0.66 0.07-0.52 0.28-0.87 0.51-1.07-1.78-0.2-3.64-0.89-3.64-3.95 0-0.87 0.31-1.59 0.82-2.15-0.08-0.2-0.36-1.02 0.08-2.12 0 0 0.67-0.21 2.2 0.82 0.64-0.18 1.32-0.27 2-0.27 0.68 0 1.36 0.09 2 0.27 1.53-1.04 2.2-0.82 2.2-0.82 0.44 1.1 0.16 1.92 0.08 2.12 0.51 0.56 0.82 1.27 0.82 2.15 0 3.07-1.87 3.75-3.65 3.95 0.29 0.25 0.54 0.73 0.54 1.48 0 1.07-0.01 1.93-0.01 2.2 0 0.21 0.15 0.46 0.55 0.38C13.71 14.53 16 11.53 16 8 16 3.58 12.42 0 8 0z"></path></svg></span>
                       <span style="height:16px;">使用GitHub账号登陆</span>
                    </a>
                </div>
                <!--<div class="form-group">
                    <button class="btn btn-default btn-block" ng-click="authenticate('github')">使用Coding.net账号登陆</button>
                </div>-->
            </div>
            <div class="box-separator"></div>
            <div class="box">
                <h4>Email账号登陆</h4>
                <form name="loginform" class="wiki-form">
                    <div class="form-group" ng-class="{ 'has-error': loginform.email.$dirty && !loginform.email.$valid }">
                        <input type="email" name="email" placeholder="输入Email地址" class="form-control" ng-model="email" required />
                    </div>
                    <div class="form-group" ng-class="{ 'has-error': loginform.password.$dirty && !loginform.password.$valid }">
                        <input type="password" name="password" ng-minlength="6" ng-maxlength="20" placeholder="密码" class="form-control" ng-model="password" required />
                    </div>
                    <div class="form-actions">
                        <button class="btn btn-primary btn-block" ng-click="loginUser(email, password)" ng-disabled="!loginform.$valid || loading" ng-class="{loading: loading}">登录</button>
                    </div>
                    <div class="mt-1">
                        <a ng-click="register()" style="cursor:pointer">没有账户? 马上注册</a>
                    </div>
                </form>
            </div>
            <div style="clear:both"></div>
        </div>
    </div>
</div>
